import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'

// 引入 uView UI
import uView from '@/uni_modules/uview-ui'
Vue.use(uView)

// 请求工具
import request from '@/utils/request'
Vue.prototype.$http = request

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import uView from '@/uni_modules/uview-ui'
import { createSSRApp } from 'vue'
import request from '@/utils/request' // Vue3 也引入

export function createApp() {
  const app = createSSRApp(App)
  app.use(uView)

  // 挂载 $http
  app.config.globalProperties.$http = request

  return {
    app
  }
}
// #endif